import request from '@/utils/request'
import { member } from '../baseUrl'
const user = member + '/user'
// 用户全部列表
export function userAll(data) {
  return request({
    url: user + '/getAllList ',
    method: 'post',
    data
  })
}
// 用户列表分页
export function userPageList(data) {
  return request({
    url: user + '/getPageList',
    method: 'post',
    data
  })
}
// 获取所有用户
export function getUserList() {
  return request({
    url: user + '/getAllList',
    method: 'post',
    data: { params: {} }
  })
}

// 获取所有用户
export function getOrganUserAll() {
  return request({
    url: user + '/getOrganFrame',
    method: 'get',
  })
}

// 用户删除
export function userDel(data) {
  return request({
    url: user + '/del',
  })
}
// 用户信息查询
export function getUserInfo(params) {
  return request({
    url: user + '/get',
    method: 'post',
    params
  })
}

// 用户新增
export function userAdd(data) {
  return request({
    url: user + '/add',
    method: 'post',
    data
  })
}
// 用户编辑
export function userUpdate(data) {
  return request({
    url: user + '/update',
    method: 'post',
    data
  })
}
// 用户批量删除
export function userDelBatch(data) {
  return request({
    url: user + '/delBatch',
    method: 'post',
    data
  })
}

// 重置用户密码
export function resetPwd(data) {
  return request({
    url: user + '/modifyUserPassword',
    method: 'post',
    data
  })
}

// 用户导入
export function userImport(data) {
  return request({
    url: user + '/import',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data,
  })
}


//异常导出excel
export function userErrExport(data) {
  return request({
    url: user + '/errorExport/' + data,
    method: 'get',
    responseType: 'blob',
  })
}


//用户导出excel
export function userExport(data) {
  return request({
      url: user + '/export',
      method: 'post',
      responseType: 'blob',
      data,
  })
}